package com.inmarry.filter;

import java.io.IOException;
import javax.servlet.*;

/**
 * 项目:    www.in-marry.com
 * 文件:    src/filter/SetCharacter.java
 *
 * 设定用户请求的字符编码为UTF-8
 *
 * @author: Mike.Guo <hylinux@gmail.com> or <ghw@5anet.com>
 * @version:    $Id:$
 */
public final class SetCharacter implements Filter {
    public void doFilter(
            ServletRequest req,
            ServletResponse res,
            FilterChain chain ) throws IOException,
           ServletException {
        
        req.setCharacterEncoding("UTF-8");
        chain.doFilter(req,res);
    }

    public void destroy() {


    }

    public void init(FilterConfig config) throws ServletException {


    }

}

